#ifndef VLCWIDGET_H
#define VLCWIDGET_H

#include <QWidget>

#include <vlc/vlc.h>

QT_BEGIN_NAMESPACE
namespace Ui { class VLCWidget; }
QT_END_NAMESPACE

class VLCWidget : public QWidget
{
    Q_OBJECT

public:
    VLCWidget(QWidget *parent = nullptr);
    ~VLCWidget();

    void setTimeSlider(int value);
        void setTimeLabel(const QString & str);

        libvlc_media_player_t * mediaPlayer() const {   return _pMediaPlayer;}
        libvlc_time_t toalSecs() const {    return _totalSec;}

private slots:
    void on_btnOpen_clicked();

    void on_btnPlayer_clicked();

    void on_btnPause_clicked();

    void on_btnStop_clicked();

private:
    Ui::VLCWidget *ui;

    libvlc_instance_t *         _pInstance = nullptr;
    libvlc_media_t *            _pMedia = nullptr;
    libvlc_media_player_t *     _pMediaPlayer = nullptr;
    libvlc_event_manager_t *    _pEventManager = nullptr;
    libvlc_time_t               _totalSec = 0;
};
#endif // VLCWIDGET_H
